//
//  C_1ViewController.m
//  RACExamale
//
//  Created by cym_bj on 2017/11/30.
//  Copyright © 2017年 com.cym. All rights reserved.
//

#import "C_1ViewController.h"
#import "C1View.h"
@interface C_1ViewController ()

@property (nonatomic,weak) IBOutlet C1View *c1View;
@property (weak, nonatomic) IBOutlet UIButton *btn3;

@end

@implementation C_1ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title=@"按钮点击、代理";
    
    //监听按钮一的点击事件
    [self.c1View.subjectSigin subscribeNext:^(id  _Nullable x) {

        NSLog(@"%@",x);
        NSLog(@"按钮被点击了");

    }];
    
    //方式二，直接监听方法， 按钮二的监听  代理方法
    [[self.c1View rac_signalForSelector:@selector(btn2Click:)] subscribeNext:^(RACTuple * _Nullable x) {
        
        // x 是被监听的按钮
        NSLog(@"按钮被点击了%@",x);
    }];
    
    
    //方式三: 按钮三点击点击方式
    
    [[self.btn3 rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
       
        NSLog(@"按钮被点击了:%@",x);
        
    }];
    
    
    
    

}




@end
